using Agron.Data.Contracts;

using System;
using System.ServiceModel;


namespace Agron.Services.Contracts
{
    /// <summary>
    /// Defines the service-contract for the <c>Memberhip Service</c>.
    /// </summary>
    [ServiceContract(Namespace = "http://services.udlap.mx/Agron/MembershipService.svc")]
    public interface IMembershipService
    {
        /// <summary>
        /// Verifies that the supplied user name and password are valid.
        /// </summary>
        /// <param name="username">The name of the user to be validated.</param>
        /// <param name="password">The password for the specified user.</param>
        /// <returns>true if the supplied user name and password are valid; otherwise, false.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="username"/> is null or empty.</exception>
        [OperationContract]
        bool ValidateUser(string username, string password);

        /// <summary>
        /// Gets the information from the data source for the specified membership user.
        /// </summary>
        /// <param name="username">The name of the user to be validated.</param>
        /// <returns>A <see cref="UserProfile"/> object representing the user.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="username"/> is null or empty.</exception>
        [OperationContract]
        UserProfile GetUserProfileByUserName(string username);

        /// <summary>
        /// Gets the information from the data source for the specified membership user using a database identifier.
        /// </summary>
        /// <param name="userId">The name of the user to be validated.</param>
        /// <returns>A <see cref="UserProfile"/> object representing the user.</returns>
        [OperationContract]
        UserProfile GetUserProfileByUserId(Guid userId);

        /// <summary>
        /// Updates the database with the information for the specified user.
        /// </summary>
        /// <param name="userProfile">A <see cref="UserProfile"/> object that represents the user to be updated and the updated information for the user.</param>
        /// <exception cref="ArgumentNullException"><paramref name="userProfile"/> is null.</exception>
        [OperationContract]
        void UpdateUserProfile(UserProfile userProfile);
    }
}
